﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MCPlatform.Communicate.Modbus.Modbus;
using MCPlatform.Communicate.TcpIp;
using MCPlatform.MotionLib.Base.AssitantClass;
using Newtonsoft.Json;
using Panuon.WPF;
using Panuon.WPF.UI;
namespace MCPlatform.Communicate.Modbus
{
    public class ModbusTCPModel: NotifyPropertyChangedBase, INameProvider
    {
        #region Properties

        [Newtonsoft.Json.JsonIgnore]
        public TCPMaster? TCPMaster { get => _TCPMaster; set => Set(ref _TCPMaster, value); }
        [Newtonsoft.Json.JsonIgnore]
        private TCPMaster? _TCPMaster;
        public string ControlName { get => _ControlName; set => Set(ref _ControlName, value); }
        private string _ControlName = "上料机器人";
      
        public string IPAddr { get => _IPAddr; set => Set(ref _IPAddr, value); }
        private string _IPAddr = "127.0.0.1";

        public int Port { get => _Port; set => Set(ref _Port, value); }
        private int _Port = 502;

        public byte SlaveAddr { get => _SlaveAddr; set => Set(ref _SlaveAddr, value); }
        private byte _SlaveAddr = 2;

        public string SlaveName { get => _SlaveName; set => Set(ref _SlaveName, value); }
        public string _SlaveName = "Load Robot";

        public bool IsAutoRetry { get => _IsAutoRetry; set => Set(ref _IsAutoRetry, value); }
        public bool _IsAutoRetry =false;

        #endregion

        public ModbusTCPModel()
        {
            TCPMaster = new TCPMaster(this);
        }

    }
}
